package shopsim.data;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

public class AFP {
	
	private String path = "Produkte.txt";
	private String zeile = "";
	
	public AFP(){
		try {
			BufferedReader reader = new BufferedReader(new FileReader (path));

			String wort = "";
			String zeichen = "";
			String[] tmp = new String[5];
			int counter = 0;
			
			while(zeile != null)
			{
				zeile = reader.readLine();
				
				while(zeile != null && zeile.equals("") == false)
				{
					while(zeile.length() >= 1 && zeichen.equals(";") == false)
					{
						wort = wort + zeichen;
						zeichen = zeile.substring(0, 1);
						zeile = zeile.substring(1, zeile.length());
					}
					
					tmp[counter] = wort;
					counter++;
					wort = "";
					zeichen = "";
					
					if(counter == 5)
					{
						switch(Integer.parseInt(tmp[2]))
						{
							case 1: break;
							case 2: break;
							case 3: break;
							case 4: break;
							case 5: break;
						}
						
						counter = 0;
					}
				}
			}
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
